<template>
  <div style="height: 765px">

    <!--主体内容-->
    <el-row :gutter="0" style="background:white;border-bottom: 1px solid #CCCCCC;margin: -20px;text-align: left;height: 40px;line-height: 40px">
      <el-col :span="24" :offset="0" style="">
        <el-button type="text" @click="goback">< 还款记录 贷款证明</el-button>
      </el-col>
    </el-row>

    <el-row :gutter="0" style="margin-top: 40px;margin-bottom: 20px">
        <el-button-group>
          <el-button type="" style="width: 214px" @click="fun1">借款记录</el-button>
          <el-button type="primary" style="width: 214px" @click="fun2">还款记录</el-button>
        </el-button-group>
    </el-row>
    <el-row :gutter="0" style="border-bottom: 1px solid #CCCCCC;padding:10px;background-color:white" v-for="(o, index) in person" :key="o.id" :offset="index  > 0 ? 2 : 0" >
      <el-col :span="15"  style="padding: 5px;">
        <div>金钱：{{o.loanapplication.loanAmount}}</div>
        <div>时间：
      <!--    <el-date-picker
            type="datetime"
            default-value
            placeholder="选择日期"
            v-model="o.loanrepayment.repaymentTime"
            format="yyyy - MM - dd  HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>-->
          {{o.loanrepayment.repaymentTime}}</div>
      </el-col>

      <el-col :span="4" :offset="2" style="">
        <el-link type="_blank" @click="fun1" style="">
          <!--已还款-->{{o.loanrepayment.paymentStatus}}
        </el-link>
      </el-col>
    </el-row>



    <!--<el-row :gutter="0" style="border-bottom: 1px solid green;padding:10px;background-color:white">
      <el-col :span="7" :offset="0" style="">
        <div>500.00</div>
        <div>2020年11月02日</div>
      </el-col>

      <el-col :span="6" :offset="11" style="">
        <el-link type="_blank" @click="fun1" style="">
          已还款
        </el-link>
      </el-col>
    </el-row>-->

  </div>
</template>

<script>
  import axios from  'axios'
    export default {
      name: "repaymentRecord",
      data(){
        return{
          borrowerId:1,
          paymentStatus:"已结清",
          person:[],
          form:{},
          loanAmount:'',
          repaymentTime:'',
        };

      },
      methods: {
        findPartMessagePaymentStatus:function(){
          // alert("shiyan1");
          // alert("id"+borrowerId+",asdas"+paymentStatus);
          axios.post("http://localhost:9999/credit-personal/findPartMessagePaymentStatus", {borrowerId:this.borrowerId,paymentStatus:this.paymentStatus}).then(res=>{
            // alert("shiyan");
            this.person=res.data;
          /*  this.pay=res.data[0].loanrepayment.payableInterest;
            this.paymentStatus = res.data[0].loanrepayment.paymentStatus;
            this.repaymentTime=res.data[0].loanrepayment.repaymentTime;
            this.loanAmount=res.data[0].loanapplication.loanAmount;*/
            console.log(res.data);//控制台数据
          })

        },

        goback:function () {
          this.$router.push("/personal")
        },
        fun1:function () {
          this.$router.push("/borrowRecord")
        },
        fun2:function () {
          this.$router.push("/repaymentRecord")
        }
      },
      mounted(){
        this.findPartMessagePaymentStatus(1,"已结清");//name,paymentStatus
      }
    }
</script>

<style scoped>

</style>
